<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Teacher Dashboard</title>
    <style>
        /* 全局样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            color: #333;
            margin: 0;
            padding: 0;
        }

        /* 顶部导航栏 */
        .navbar {
            background-color: #343a40;
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: white;
        }

        .navbar .navbar-brand {
            font-size: 1.5rem;
            font-weight: bold;
            color: white;
            text-decoration: none;
        }

        .navbar a {
            color: white;
            text-decoration: none;
            font-size: 1rem;
            margin-left: 1rem;
        }

        .navbar a:hover {
            text-decoration: underline;
        }

        /* 主容器 */
        .container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 1rem;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 1.5rem;
            color: #343a40;
        }

        /* 表单样式 */
        form {
            margin-bottom: 2rem;
        }

        label {
            font-size: 1.25rem;
            color: #555;
            margin-bottom: 0.5rem;
            display: block;
        }

        input[type="text"] {
            width: 100%;
            padding: 0.5rem;
            font-size: 1.25rem;
            margin-bottom: 1rem;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        button {
            padding: 0.75rem 1.5rem;
            font-size: 1.25rem;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        button.btn-primary {
            background-color: #007bff;
            color: white;
        }

        button.btn-primary:hover {
            background-color: #0056b3;
        }

        button.btn-secondary {
            background-color: #6c757d;
            color: white;
        }

        button.btn-secondary:hover {
            background-color: #565e64;
        }
    </style>
</head>
<body>
    <div class="navbar">
        <a class="navbar-brand" href="#">教师控制台</a>
        <a href="{{ url_for('login') }}">退出登录</a>
    </div>

    <div class="container">
        <h1>欢迎, {{ username }}!</h1>

        <!-- 添加考试入口 -->
        <form method="POST" action="{{ url_for('teacher_dashboard', username=username) }}">
            <button type="submit" name="add_exam" class="btn-primary">添加考试</button>
        </form>

        <!-- 班级管理 -->
        <form method="POST" action="{{ url_for('manage_class', username=username) }}">
            <label for="class_name">班级名称:</label>
            <input type="text" id="class_name" name="class_name" placeholder="请输入班级名称">
            <button type="submit" class="btn-secondary">管理班级</button>
        </form>
    </div>
</body>
</html>
